<template>
  <div id="micro-app" class="dog">
    <router-view/>
    <Login />
  </div>
</template>

<script>
import ds from '@/service/components/ds'
import ebus from '@/components/ebus'
import Login from '@/components/login/login.vue'

export default {
  name: 'App',

  components: {
    Login
  },

  created () {
    ds.$on('onAfterRequest', (result) => {
      let options = result.options
      if (
        result && result.response &&
        String(result.response.status) === '403'
      ) {
        // 弹出窗口
        ebus.$emit('onShowLogin')
        // 登录超时
        ebus.$emit('onLoginExpire')
      } else if (
        result && result.response &&
        String(result.response.status) === '401'
      ) {
        // 弹出窗口
        this.$message({
          message: '暂无权限进行此操作',
          type: 'error'
        })
      } else {
        if (options.isShowError !== false) {

        }
      }
    })
  },

  mounted () {
    let lm = document.querySelector('.d-loading-maker')
    lm && (lm.style.display = 'none')
  }
}
</script>

<style lang="less">
@media(max-width: 756px) {
  ::-webkit-scrollbar {
    display: none!important;
    width: 0px;  
    height: 0px;  
  }
}
.block-item {
  padding: 24px;
  width: 200px;
  line-height: 24px;
  text-align: center;
  color: #fff;
}
.block-simple {
  width: 200px;
  line-height: 24px;
  text-align: center;
  color: #fff;
}
@media (max-width: 860px) {
  .d-nav-bar {
    flex: 1;
  }
  .navbar-toggle {
    display: block !important;
  }
  .nav-bar-group {
    display: none;
  }
}
</style>
